﻿using ML.Entity;

namespace ML.IBusiness
{
    /// <summary>
    /// 邀请计数业务
    /// </summary>
    public interface IInvitationProfitBusiness
    {
        /// <summary>
        /// 根据用户id更新邀请数量
        /// </summary>
        /// <param name="invitationCount">邀请数量</param>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        BaseResult<bool> UpdataInvitationCountByUserId(int invitationCount, string userId);

        /// <summary>
        /// 根据用户id更新成功邀请数量
        /// </summary>
        /// <param name="successCount">成功邀请数量</param>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        BaseResult<bool> UpdataSuccessCountCountByUserId(int successCount, string userId);

        /// <summary>
        /// 根据用户id获取信息
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        BaseResult<InvitationProfitEntity> GetByUserId(string userId);

        /// <summary>
        /// 添加邀请计数（如果已经存在该用户信息，则只更新邀请数量）
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        BaseResult<bool> Add(InvitationProfitEntity entity);
    }
}